/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import controller.CargosJpaController;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Renato
 */
@Entity
@Table(name = "cargos")
@NamedQueries({@NamedQuery(name = "Cargos.findAll", query = "SELECT c FROM Cargos c"), @NamedQuery(name = "Cargos.findById", query = "SELECT c FROM Cargos c WHERE c.id = :id"), @NamedQuery(name = "Cargos.findByCargo", query = "SELECT c FROM Cargos c WHERE c.cargo = :cargo"), @NamedQuery(name = "Cargos.findBySalarioBase", query = "SELECT c FROM Cargos c WHERE c.salarioBase = :salarioBase")})
public class Cargos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "cargo")
    private String cargo;
    @Basic(optional = false)
    @Column(name = "salario_base")
    private double salarioBase;

    public Cargos() {
    }

    public Cargos(Integer id) {
        this.id = id;
    }

    public Cargos(Integer id, String cargo, double salarioBase) {
        this.id = id;
        this.cargo = cargo;
        this.salarioBase = salarioBase;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCargo() {
        return cargo;
    }

    public void setCargo(String cargo) {
        this.cargo = cargo;
    }

    public double getSalarioBase() {
        return salarioBase;
    }

    public void setSalarioBase(double salarioBase) {
        this.salarioBase = salarioBase;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Object)) {
            return false;
        }

        Cargos other = new Cargos();
        CargosJpaController aux = new CargosJpaController();
        other = aux.findCargos(id);
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return ""+id+"";
    }

}
